﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
   public class ManagePostsDataModel
    {
       HomestayWebDBEntities ent = new HomestayWebDBEntities();
       public List<Post_ManagePosts_View> GetListPosts (int status)
       {
           List<Post_ManagePosts_View> listAllPosts = ent.Store_Post_ManagePosts(status).ToList();

           return listAllPosts;
       }

       public int GetTimeRejectedPost (int postId)
       {
           int timeRejected = Convert.ToInt32(ent.Store_Post_TimeRejectedPost(postId).FirstOrDefault());
           return timeRejected;
       }
 
       public void DeletePost (int posId)
       {
           ent.Store_ManagePosts_DeletePost(posId);
       }
    }
}
